/**
 * author:Administrator
 * date:2016/2/23
 * desc:TODO
 */
'use strict';

let Repo = require('./ShopWareRepo.js');

let STATUS_ENUM = {
  online: 'online',       // 1,
  offline: 'offline',     // 2
  offshelf: 'offshelf',   // 下架
};

class ShopWare {
  constructor(pojo) {
    pojo = pojo || {};
    this.id = pojo.id;
    this.shopId = pojo.shopId;
    this.wareId = pojo.wareId;
    this.categoryId = pojo.categoryId;
    this.locationId = pojo.locationId;
    this.vendorId = pojo.vendorId;
    this.status = pojo.status || STATUS_ENUM.online;
  }

  * store() {
    return yield Repo.store(this);
  }

}
ShopWare.STATUS_ENUM = STATUS_ENUM;
module.exports = ShopWare;